package com.yj.springbootautoconfig;

import com.yj.springbootautoconfig.aotuconfig.TestService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class SpringBootAutoconfigApplication {

    public static void main(String[] args) {

        ConfigurableApplicationContext context = new SpringApplicationBuilder(SpringBootAutoconfigApplication.class).web(WebApplicationType.NONE).run(args);
        String hello = context.getBean("hello",String.class);
        System.out.println(hello);
    }

}
